/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.src.dao;

import java.util.ArrayList;
import java.util.Map;
import com.src.pojos.Cls_Contribuyente;
import com.src.utiles.Cls_Parametros;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

/**
 *
 * @author Christian
 */
public class Cls_Dao_Contribuyente extends SqlMapClientDaoSupport implements Itf_Dao_Contribuyente{
    public ArrayList<Cls_Contribuyente> obtenerTodosContribuyentes(Map<String,String> parametros){
        try{
            return (ArrayList<Cls_Contribuyente>)this.getSqlMapClientTemplate().
                    queryForList(Cls_Parametros.FuncionIbt_OBTENER_TODOS_CONTRIBUYENTES,parametros,
                    (Integer.parseInt((String)parametros.get("page"))-1)*Integer.parseInt((String)parametros.get("rp")),
                    Integer.parseInt((String)parametros.get("rp")));
        }catch(DataAccessException ex){
            ex.printStackTrace();
            return null;
        }
    }
}
